<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/underscore.js"></script>
    <script src="js/jquery-3.1.1.js"></script>
</head>
<body>
<script>

    var greet=function (username){
    //function greet(username){
        console.log("hello,"+username);
        console.log("hello,"+arguments[0]);
    }

    greet("liuxiaofeng");
    greet.call(null,"liuxiaofeng");
    greet.apply(null,["liuxiaofeng"]);
    //TODO 为abc再增加一个形式参数，再试试call,apply.

    //对象
    var obj={};
    obj.username='liuxiaofeng';
    obj.greet=function(x){console.log("hi,"+x)};

    var obj={
        username:"liuxiaofeng",greet:function(x){console.log("hi,"+x)}
    }
    obj.greet();
    obj.greet.call(null,obj.username);
    obj.greet.apply(null,[obj.username]);

    obj.greet=function(){console.log("hi,"+this.username)};
    obj.greet();
    obj.greet.call(obj);
    obj.greet.apply(obj);

        //this总结，与java/c#中this的区别

    //留意each的第三个参数context
    _.each(["hello ","hi ","you "],function(x){
        console.log(x+this.username);
    },obj);


    console.log(obj);
    console.log(JSON.stringify(obj));
    var objstr=JSON.stringify(obj);
    var cloneobj=JSON.parse(objstr);
    console.log(cloneobj);
    //TODO 总结JSON格式，JSON.parse()与JSON.stringify()



    //TODO采用jquery的ajax访问这个网址(www.embracex.org:7777/ment/all)的数据并输出数组元素的content内容
    //参考手册:http://jquery.cuishifeng.cn

    //TODO 把它现实再界面上，以任何方式,可以参考jQuery中【文档处理部分】

    //TODO 思考前后端分离的意思

    









</script>
</body>
</html>